package iterator.improve;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 信息工程学院，ConcreteAggregate
 */
public class InfoCollege implements College {
    // 维护一个院系
    private final List<Department> departments;

    public InfoCollege() {
        departments = new ArrayList<>();
        addDepartment(new Department("信息安全专业", " 信息安全专业 "));
        addDepartment(new Department("网络安全专业", " 网络安全专业 "));
        addDepartment(new Department("服务器安全专业", " 服务器安全专业 "));
    }

    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public Iterator<Department> createIterator() {
        return new InfoColleageIterator(departments);
    }

    @Override
    public void addDepartment(Department department) {
        departments.add(department);
    }
}
